/********************************************************************
FileName    :   Dal_spdaH.cs
CreateTime  :   2019-01-17 01:01
BaseClass   :   Dal_spdaH
FileType    :   .cs
Author      :  minjie
Description :   Dal_spdaHDAL层（简单三层）
*********************************************************************/

using System;
using System.Text;
using System.Data.SqlClient;
using System.Collections.Generic;

using System.Data;
using HT.DBUtility;

namespace HT.DAL
{
	/// <summary>
	/// Dal_spdaH的摘要说明。
	/// </summary>
	public partial class Dal_spdaH 
  	{ 
     		      
  		public bool Exists() 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("select count(1) from spdaH"); 
           SqlParameter[] parameters = { };  
          			return DbHelperSQL.Exists(strSql.ToString(),parameters); 
  		} 
  		 
  				 
  		 
  		/// <summary> 
  		/// 增加一条数据 
  		/// </summary> 
  		public  bool  Add(spdaH_Entity model) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("insert into spdaH(");			 
  	        strSql.Append("DjLsh,DjBtZdh,DjFtZdh,DjStZdh,DjState,DjCount,bhfs,djcl,lsh,rq,dlbh,dlmc,xlbh,xlmc,gysbh,Gysmc,cjhh,spbh,tmh,spmc,gg,ysbh,ysmc,cm,Pyjm,ddw,xdw,dwhsz,jj,Lsj_Jsz,Lsj_Csxs,pfj_Jsz,pfj_Csxs,pfj,Jmlsj,pfzk,Hyzz,Hyyh,tp,spzt,qdpl,Ccrq,bzq,tqyjts,zdkc,zxkc,zjhl,bz,zhjhsj,sccgybh,djyh,djsj,xgyh,xgsj,cwm,fhljs,sfdz,dysl,ydy,drlsh) values ("); 
  	        strSql.Append("	@DjLsh,@DjBtZdh,@DjFtZdh,@DjStZdh,@DjState,@DjCount,@bhfs,@djcl,@lsh,@rq,@dlbh,@dlmc,@xlbh,@xlmc,@gysbh,@Gysmc,@cjhh,@spbh,@tmh,@spmc,@gg,@ysbh,@ysmc,@cm,@Pyjm,@ddw,@xdw,@dwhsz,@jj,@Lsj_Jsz,@Lsj_Csxs,@pfj_Jsz,@pfj_Csxs,@pfj,@Jmlsj,@pfzk,@Hyzz,@Hyyh,@tp,@spzt,@qdpl,@Ccrq,@bzq,@tqyjts,@zdkc,@zxkc,@zjhl,@bz,@zhjhsj,@sccgybh,@djyh,@djsj,@xgyh,@xgsj,@cwm,@fhljs,@sfdz,@dysl,@ydy,@drlsh	 ) "); 
  			SqlParameter[] parameters = { 
              new SqlParameter("@DjLsh", SqlDbType.Int,4) ,              
              new SqlParameter("@DjBtZdh", SqlDbType.Int,4) ,              
              new SqlParameter("@DjFtZdh", SqlDbType.Int,4) ,              
              new SqlParameter("@DjStZdh", SqlDbType.Int,4) ,              
              new SqlParameter("@DjState", SqlDbType.Char,10) ,              
              new SqlParameter("@DjCount", SqlDbType.Int,4) ,              
              new SqlParameter("@bhfs", SqlDbType.VarChar,50) ,              
              new SqlParameter("@djcl", SqlDbType.VarChar,50) ,              
              new SqlParameter("@lsh", SqlDbType.Int,4) ,              
              new SqlParameter("@rq", SqlDbType.VarChar,50) ,              
              new SqlParameter("@dlbh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@dlmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@xlbh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@xlmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@gysbh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@Gysmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@cjhh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@spbh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@tmh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@spmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@gg", SqlDbType.VarChar,50) ,              
              new SqlParameter("@ysbh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@ysmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@cm", SqlDbType.VarChar,50) ,              
              new SqlParameter("@Pyjm", SqlDbType.VarChar,50) ,              
              new SqlParameter("@ddw", SqlDbType.VarChar,50) ,              
              new SqlParameter("@xdw", SqlDbType.VarChar,50) ,              
              new SqlParameter("@dwhsz", SqlDbType.Decimal,9) ,              
              new SqlParameter("@jj", SqlDbType.Money) ,              
              new SqlParameter("@Lsj_Jsz", SqlDbType.Decimal,9) ,              
              new SqlParameter("@Lsj_Csxs", SqlDbType.Decimal,9) ,              
              new SqlParameter("@pfj_Jsz", SqlDbType.Decimal,9) ,              
              new SqlParameter("@pfj_Csxs", SqlDbType.Decimal,9) ,              
              new SqlParameter("@pfj", SqlDbType.Money) ,              
              new SqlParameter("@Jmlsj", SqlDbType.Money) ,              
              new SqlParameter("@pfzk", SqlDbType.Decimal,9) ,              
              new SqlParameter("@Hyzz", SqlDbType.Decimal,9) ,              
              new SqlParameter("@Hyyh", SqlDbType.Decimal,9) ,              
              new SqlParameter("@tp", SqlDbType.Image) ,              
              new SqlParameter("@spzt", SqlDbType.VarChar,50) ,              
              new SqlParameter("@qdpl", SqlDbType.Int,4) ,              
              new SqlParameter("@Ccrq", SqlDbType.DateTime) ,              
              new SqlParameter("@bzq", SqlDbType.Int,4) ,              
              new SqlParameter("@tqyjts", SqlDbType.Int,4) ,              
              new SqlParameter("@zdkc", SqlDbType.Int,4) ,              
              new SqlParameter("@zxkc", SqlDbType.Int,4) ,              
              new SqlParameter("@zjhl", SqlDbType.Int,4) ,              
              new SqlParameter("@bz", SqlDbType.VarChar,50) ,              
              new SqlParameter("@zhjhsj", SqlDbType.DateTime) ,              
              new SqlParameter("@sccgybh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@djyh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@djsj", SqlDbType.DateTime) ,              
              new SqlParameter("@xgyh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@xgsj", SqlDbType.DateTime) ,              
              new SqlParameter("@cwm", SqlDbType.VarChar,50) ,              
              new SqlParameter("@fhljs", SqlDbType.Int,4) ,              
              new SqlParameter("@sfdz", SqlDbType.Bit) ,              
              new SqlParameter("@dysl", SqlDbType.Int,4) ,              
              new SqlParameter("@ydy", SqlDbType.Bit) ,              
              new SqlParameter("@drlsh", SqlDbType.Int,4)};             
              parameters[0].Value = model.DjLsh;  
              
              parameters[1].Value = model.DjBtZdh;  
              
              parameters[2].Value = model.DjFtZdh;  
              
              parameters[3].Value = model.DjStZdh;  
              
           if (model.DjState != null)  
              parameters[4].Value = model.DjState;  
           else  
              parameters[4].Value = DBNull.Value;  
              
              parameters[5].Value = model.DjCount;  
              
           if (model.bhfs != null)  
              parameters[6].Value = model.bhfs;  
           else  
              parameters[6].Value = DBNull.Value;  
              
           if (model.djcl != null)  
              parameters[7].Value = model.djcl;  
           else  
              parameters[7].Value = DBNull.Value;  
              
              parameters[8].Value = model.lsh;  
              
           if (model.rq != null)  
              parameters[9].Value = model.rq;  
           else  
              parameters[9].Value = DBNull.Value;  
              
           if (model.dlbh != null)  
              parameters[10].Value = model.dlbh;  
           else  
              parameters[10].Value = DBNull.Value;  
              
           if (model.dlmc != null)  
              parameters[11].Value = model.dlmc;  
           else  
              parameters[11].Value = DBNull.Value;  
              
           if (model.xlbh != null)  
              parameters[12].Value = model.xlbh;  
           else  
              parameters[12].Value = DBNull.Value;  
              
           if (model.xlmc != null)  
              parameters[13].Value = model.xlmc;  
           else  
              parameters[13].Value = DBNull.Value;  
              
           if (model.gysbh != null)  
              parameters[14].Value = model.gysbh;  
           else  
              parameters[14].Value = DBNull.Value;  
              
           if (model.Gysmc != null)  
              parameters[15].Value = model.Gysmc;  
           else  
              parameters[15].Value = DBNull.Value;  
              
           if (model.cjhh != null)  
              parameters[16].Value = model.cjhh;  
           else  
              parameters[16].Value = DBNull.Value;  
              
           if (model.spbh != null)  
              parameters[17].Value = model.spbh;  
           else  
              parameters[17].Value = DBNull.Value;  
              
           if (model.tmh != null)  
              parameters[18].Value = model.tmh;  
           else  
              parameters[18].Value = DBNull.Value;  
              
           if (model.spmc != null)  
              parameters[19].Value = model.spmc;  
           else  
              parameters[19].Value = DBNull.Value;  
              
           if (model.gg != null)  
              parameters[20].Value = model.gg;  
           else  
              parameters[20].Value = DBNull.Value;  
              
           if (model.ysbh != null)  
              parameters[21].Value = model.ysbh;  
           else  
              parameters[21].Value = DBNull.Value;  
              
           if (model.ysmc != null)  
              parameters[22].Value = model.ysmc;  
           else  
              parameters[22].Value = DBNull.Value;  
              
           if (model.cm != null)  
              parameters[23].Value = model.cm;  
           else  
              parameters[23].Value = DBNull.Value;  
              
           if (model.Pyjm != null)  
              parameters[24].Value = model.Pyjm;  
           else  
              parameters[24].Value = DBNull.Value;  
              
           if (model.ddw != null)  
              parameters[25].Value = model.ddw;  
           else  
              parameters[25].Value = DBNull.Value;  
              
           if (model.xdw != null)  
              parameters[26].Value = model.xdw;  
           else  
              parameters[26].Value = DBNull.Value;  
              
           if (model.dwhsz != null)  
              parameters[27].Value = model.dwhsz;  
           else  
              parameters[27].Value = DBNull.Value;  
              
           if (model.jj != null)  
              parameters[28].Value = model.jj;  
           else  
              parameters[28].Value = DBNull.Value;  
              
           if (model.Lsj_Jsz != null)  
              parameters[29].Value = model.Lsj_Jsz;  
           else  
              parameters[29].Value = DBNull.Value;  
              
           if (model.Lsj_Csxs != null)  
              parameters[30].Value = model.Lsj_Csxs;  
           else  
              parameters[30].Value = DBNull.Value;  
              
           if (model.pfj_Jsz != null)  
              parameters[31].Value = model.pfj_Jsz;  
           else  
              parameters[31].Value = DBNull.Value;  
              
           if (model.pfj_Csxs != null)  
              parameters[32].Value = model.pfj_Csxs;  
           else  
              parameters[32].Value = DBNull.Value;  
              
           if (model.pfj != null)  
              parameters[33].Value = model.pfj;  
           else  
              parameters[33].Value = DBNull.Value;  
              
           if (model.Jmlsj != null)  
              parameters[34].Value = model.Jmlsj;  
           else  
              parameters[34].Value = DBNull.Value;  
              
           if (model.pfzk != null)  
              parameters[35].Value = model.pfzk;  
           else  
              parameters[35].Value = DBNull.Value;  
              
           if (model.Hyzz != null)  
              parameters[36].Value = model.Hyzz;  
           else  
              parameters[36].Value = DBNull.Value;  
              
           if (model.Hyyh != null)  
              parameters[37].Value = model.Hyyh;  
           else  
              parameters[37].Value = DBNull.Value;  
              
           if (model.tp != null)  
              parameters[38].Value = model.tp;  
           else  
              parameters[38].Value = DBNull.Value;  
              
           if (model.spzt != null)  
              parameters[39].Value = model.spzt;  
           else  
              parameters[39].Value = DBNull.Value;  
              
              parameters[40].Value = model.qdpl;  
              
           if (model.Ccrq != null)  
              parameters[41].Value = model.Ccrq;  
           else  
              parameters[41].Value = DBNull.Value;  
              
              parameters[42].Value = model.bzq;  
              
              parameters[43].Value = model.tqyjts;  
              
              parameters[44].Value = model.zdkc;  
              
              parameters[45].Value = model.zxkc;  
              
              parameters[46].Value = model.zjhl;  
              
           if (model.bz != null)  
              parameters[47].Value = model.bz;  
           else  
              parameters[47].Value = DBNull.Value;  
              
           if (model.zhjhsj != null)  
              parameters[48].Value = model.zhjhsj;  
           else  
              parameters[48].Value = DBNull.Value;  
              
           if (model.sccgybh != null)  
              parameters[49].Value = model.sccgybh;  
           else  
              parameters[49].Value = DBNull.Value;  
              
           if (model.djyh != null)  
              parameters[50].Value = model.djyh;  
           else  
              parameters[50].Value = DBNull.Value;  
              
           if (model.djsj != null)  
              parameters[51].Value = model.djsj;  
           else  
              parameters[51].Value = DBNull.Value;  
              
           if (model.xgyh != null)  
              parameters[52].Value = model.xgyh;  
           else  
              parameters[52].Value = DBNull.Value;  
              
           if (model.xgsj != null)  
              parameters[53].Value = model.xgsj;  
           else  
              parameters[53].Value = DBNull.Value;  
              
           if (model.cwm != null)  
              parameters[54].Value = model.cwm;  
           else  
              parameters[54].Value = DBNull.Value;  
              
              parameters[55].Value = model.fhljs;  
              
           if (model.sfdz != null)  
              parameters[56].Value = model.sfdz;  
           else  
              parameters[56].Value = DBNull.Value;  
              
              parameters[57].Value = model.dysl;  
              
           if (model.ydy != null)  
              parameters[58].Value = model.ydy;  
           else  
              parameters[58].Value = DBNull.Value;  
              
              parameters[59].Value = model.drlsh;  
              
  			int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);			 
  			if (rows > 0) 
  			{ 
  				return true; 
  			} 
  			else 
  			{ 
              return false;; 
           }  
  		} 
  		 
  		/// <summary> 
  		/// 增加一条数据(字符串) 
  		/// </summary> 
  		public  string  AddStr(spdaH_Entity model) 
  		{ 
  				if(model.DjLsh==null) 
  				{ 
  					model.DjLsh=0; 
  				} 
  				if(model.DjBtZdh==null) 
  				{ 
  					model.DjBtZdh=0; 
  				} 
  				if(model.DjFtZdh==null) 
  				{ 
  					model.DjFtZdh=0; 
  				} 
  				if(model.DjStZdh==null) 
  				{ 
  					model.DjStZdh=0; 
  				} 
  				if(model.DjState==null) 
  				{ 
  					model.DjState="";  
  				} 
  				if(model.DjCount==null) 
  				{ 
  					model.DjCount=0; 
  				} 
  				if(model.bhfs==null) 
  				{ 
  					model.bhfs="";  
  				} 
  				if(model.djcl==null) 
  				{ 
  					model.djcl="";  
  				} 
  				if(model.lsh==null) 
  				{ 
  					model.lsh=0; 
  				} 
  				if(model.rq==null) 
  				{ 
  					model.rq="";  
  				} 
  				if(model.dlbh==null) 
  				{ 
  					model.dlbh="";  
  				} 
  				if(model.dlmc==null) 
  				{ 
  					model.dlmc="";  
  				} 
  				if(model.xlbh==null) 
  				{ 
  					model.xlbh="";  
  				} 
  				if(model.xlmc==null) 
  				{ 
  					model.xlmc="";  
  				} 
  				if(model.gysbh==null) 
  				{ 
  					model.gysbh="";  
  				} 
  				if(model.Gysmc==null) 
  				{ 
  					model.Gysmc="";  
  				} 
  				if(model.cjhh==null) 
  				{ 
  					model.cjhh="";  
  				} 
  				if(model.spbh==null) 
  				{ 
  					model.spbh="";  
  				} 
  				if(model.tmh==null) 
  				{ 
  					model.tmh="";  
  				} 
  				if(model.spmc==null) 
  				{ 
  					model.spmc="";  
  				} 
  				if(model.gg==null) 
  				{ 
  					model.gg="";  
  				} 
  				if(model.ysbh==null) 
  				{ 
  					model.ysbh="";  
  				} 
  				if(model.ysmc==null) 
  				{ 
  					model.ysmc="";  
  				} 
  				if(model.cm==null) 
  				{ 
  					model.cm="";  
  				} 
  				if(model.Pyjm==null) 
  				{ 
  					model.Pyjm="";  
  				} 
  				if(model.ddw==null) 
  				{ 
  					model.ddw="";  
  				} 
  				if(model.xdw==null) 
  				{ 
  					model.xdw="";  
  				} 
  				if(model.dwhsz==null) 
  				{ 
  					model.dwhsz=0; 
  				} 
  				if(model.jj==null) 
  				{ 
  					model.jj=0; 
  				} 
  				if(model.Lsj_Jsz==null) 
  				{ 
  					model.Lsj_Jsz=0; 
  				} 
  				if(model.Lsj_Csxs==null) 
  				{ 
  					model.Lsj_Csxs=0; 
  				} 
  				if(model.pfj_Jsz==null) 
  				{ 
  					model.pfj_Jsz=0; 
  				} 
  				if(model.pfj_Csxs==null) 
  				{ 
  					model.pfj_Csxs=0; 
  				} 
  				if(model.pfj==null) 
  				{ 
  					model.pfj=0; 
  				} 
  				if(model.Jmlsj==null) 
  				{ 
  					model.Jmlsj=0; 
  				} 
  				if(model.pfzk==null) 
  				{ 
  					model.pfzk=0; 
  				} 
  				if(model.Hyzz==null) 
  				{ 
  					model.Hyzz=0; 
  				} 
  				if(model.Hyyh==null) 
  				{ 
  					model.Hyyh=0; 
  				} 
  			 
  				if(model.spzt==null) 
  				{ 
  					model.spzt="";  
  				} 
  				if(model.qdpl==null) 
  				{ 
  					model.qdpl=0; 
  				} 
  				if(model.bzq==null) 
  				{ 
  					model.bzq=0; 
  				} 
  				if(model.tqyjts==null) 
  				{ 
  					model.tqyjts=0; 
  				} 
  				if(model.zdkc==null) 
  				{ 
  					model.zdkc=0; 
  				} 
  				if(model.zxkc==null) 
  				{ 
  					model.zxkc=0; 
  				} 
  				if(model.zjhl==null) 
  				{ 
  					model.zjhl=0; 
  				} 
  				if(model.bz==null) 
  				{ 
  					model.bz="";  
  				} 
  				if(model.sccgybh==null) 
  				{ 
  					model.sccgybh="";  
  				} 
  				if(model.djyh==null) 
  				{ 
  					model.djyh="";  
  				} 
  				if(model.xgyh==null) 
  				{ 
  					model.xgyh="";  
  				} 
  				if(model.cwm==null) 
  				{ 
  					model.cwm="";  
  				} 
  				if(model.fhljs==null) 
  				{ 
  					model.fhljs=0; 
  				} 
  				if(model.sfdz==null) 
  				{ 
  					model.sfdz=false;  
  				} 
  				if(model.dysl==null) 
  				{ 
  					model.dysl=0; 
  				} 
  				if(model.ydy==null) 
  				{ 
  					model.ydy=false;  
  				} 
  				if(model.drlsh==null) 
  				{ 
  					model.drlsh=0; 
  				} 
  		 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("insert into spdaH(");			 
  	        strSql.Append("DjLsh,DjBtZdh,DjFtZdh,DjStZdh,DjState,DjCount,bhfs,djcl,lsh,rq,dlbh,dlmc,xlbh,xlmc,gysbh,Gysmc,cjhh,spbh,tmh,spmc,gg,ysbh,ysmc,cm,Pyjm,ddw,xdw,dwhsz,jj,Lsj_Jsz,Lsj_Csxs,pfj_Jsz,pfj_Csxs,pfj,Jmlsj,pfzk,Hyzz,Hyyh,tp,spzt,qdpl,Ccrq,bzq,tqyjts,zdkc,zxkc,zjhl,bz,zhjhsj,sccgybh,djyh,djsj,xgyh,xgsj,cwm,fhljs,sfdz,dysl,ydy,drlsh) values ("); 
  	        strSql.Append("	"+ model.DjLsh+","+ model.DjBtZdh+","+ model.DjFtZdh+","+ model.DjStZdh+",'"+ model.DjState+"',"+ model.DjCount+",'"+ model.bhfs+"','"+ model.djcl+"',"+ model.lsh+",'"+ model.rq+"','"+ model.dlbh+"','"+ model.dlmc+"','"+ model.xlbh+"','"+ model.xlmc+"','"+ model.gysbh+"','"+ model.Gysmc+"','"+ model.cjhh+"','"+ model.spbh+"','"+ model.tmh+"','"+ model.spmc+"','"+ model.gg+"','"+ model.ysbh+"','"+ model.ysmc+"','"+ model.cm+"','"+ model.Pyjm+"','"+ model.ddw+"','"+ model.xdw+"',"+ model.dwhsz+","+ model.jj+","+ model.Lsj_Jsz+","+ model.Lsj_Csxs+","+ model.pfj_Jsz+","+ model.pfj_Csxs+","+ model.pfj+","+ model.Jmlsj+","+ model.pfzk+","+ model.Hyzz+","+ model.Hyyh+",'"+ model.tp+"','"+ model.spzt+"',"+ model.qdpl+",'"+ model.Ccrq+"',"+ model.bzq+","+ model.tqyjts+","+ model.zdkc+","+ model.zxkc+","+ model.zjhl+",'"+ model.bz+"','"+ model.zhjhsj+"','"+ model.sccgybh+"','"+ model.djyh+"','"+ model.djsj+"','"+ model.xgyh+"','"+ model.xgsj+"','"+ model.cwm+"',"+ model.fhljs+",'"+ model.sfdz+"',"+ model.dysl+",'"+ model.ydy+"'," +model.drlsh+"	 ) "); 
           return strSql.ToString(); 
  		} 
  		 
  		 
  		/// <summary> 
  		/// 更新一条数据 
  		/// </summary> 
  		public bool Update(spdaH_Entity model) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("update spdaH set "); 
                      strSql.Append(" DjLsh = @DjLsh,"); 
              strSql.Append(" DjBtZdh = @DjBtZdh,"); 
              strSql.Append(" DjFtZdh = @DjFtZdh,"); 
              strSql.Append(" DjStZdh = @DjStZdh,"); 
              strSql.Append(" DjState = @DjState,"); 
              strSql.Append(" DjCount = @DjCount,"); 
              strSql.Append(" bhfs = @bhfs,"); 
              strSql.Append(" djcl = @djcl,"); 
              strSql.Append(" lsh = @lsh,"); 
              strSql.Append(" rq = @rq,"); 
              strSql.Append(" dlbh = @dlbh,"); 
              strSql.Append(" dlmc = @dlmc,"); 
              strSql.Append(" xlbh = @xlbh,"); 
              strSql.Append(" xlmc = @xlmc,"); 
              strSql.Append(" gysbh = @gysbh,"); 
              strSql.Append(" Gysmc = @Gysmc,"); 
              strSql.Append(" cjhh = @cjhh,"); 
              strSql.Append(" spbh = @spbh,"); 
              strSql.Append(" tmh = @tmh,"); 
              strSql.Append(" spmc = @spmc,"); 
              strSql.Append(" gg = @gg,"); 
              strSql.Append(" ysbh = @ysbh,"); 
              strSql.Append(" ysmc = @ysmc,"); 
              strSql.Append(" cm = @cm,"); 
              strSql.Append(" Pyjm = @Pyjm,"); 
              strSql.Append(" ddw = @ddw,"); 
              strSql.Append(" xdw = @xdw,"); 
              strSql.Append(" dwhsz = @dwhsz,"); 
              strSql.Append(" jj = @jj,"); 
              strSql.Append(" Lsj_Jsz = @Lsj_Jsz,"); 
              strSql.Append(" Lsj_Csxs = @Lsj_Csxs,"); 
              strSql.Append(" pfj_Jsz = @pfj_Jsz,"); 
              strSql.Append(" pfj_Csxs = @pfj_Csxs,"); 
              strSql.Append(" pfj = @pfj,"); 
              strSql.Append(" Jmlsj = @Jmlsj,"); 
              strSql.Append(" pfzk = @pfzk,"); 
              strSql.Append(" Hyzz = @Hyzz,"); 
              strSql.Append(" Hyyh = @Hyyh,"); 
              strSql.Append(" tp = @tp,"); 
              strSql.Append(" spzt = @spzt,"); 
              strSql.Append(" qdpl = @qdpl,"); 
              strSql.Append(" Ccrq = @Ccrq,"); 
              strSql.Append(" bzq = @bzq,"); 
              strSql.Append(" tqyjts = @tqyjts,"); 
              strSql.Append(" zdkc = @zdkc,"); 
              strSql.Append(" zxkc = @zxkc,"); 
              strSql.Append(" zjhl = @zjhl,"); 
              strSql.Append(" bz = @bz,"); 
              strSql.Append(" zhjhsj = @zhjhsj,"); 
              strSql.Append(" sccgybh = @sccgybh,"); 
              strSql.Append(" djyh = @djyh,"); 
              strSql.Append(" djsj = @djsj,"); 
              strSql.Append(" xgyh = @xgyh,"); 
              strSql.Append(" xgsj = @xgsj,"); 
              strSql.Append(" cwm = @cwm,"); 
              strSql.Append(" fhljs = @fhljs,"); 
              strSql.Append(" sfdz = @sfdz,"); 
              strSql.Append(" dysl = @dysl,"); 
              strSql.Append(" ydy = @ydy,"); 
              strSql.Append(" drlsh = @drlsh"); 
  			strSql.Append(" where   "); 
  						 
           SqlParameter[] parameters = { 
                      new SqlParameter("@DjLsh", SqlDbType.Int,4) ,              
              new SqlParameter("@DjBtZdh", SqlDbType.Int,4) ,              
              new SqlParameter("@DjFtZdh", SqlDbType.Int,4) ,              
              new SqlParameter("@DjStZdh", SqlDbType.Int,4) ,              
              new SqlParameter("@DjState", SqlDbType.Char,10) ,              
              new SqlParameter("@DjCount", SqlDbType.Int,4) ,              
              new SqlParameter("@bhfs", SqlDbType.VarChar,50) ,              
              new SqlParameter("@djcl", SqlDbType.VarChar,50) ,              
              new SqlParameter("@lsh", SqlDbType.Int,4) ,              
              new SqlParameter("@rq", SqlDbType.VarChar,50) ,              
              new SqlParameter("@dlbh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@dlmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@xlbh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@xlmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@gysbh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@Gysmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@cjhh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@spbh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@tmh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@spmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@gg", SqlDbType.VarChar,50) ,              
              new SqlParameter("@ysbh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@ysmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@cm", SqlDbType.VarChar,50) ,              
              new SqlParameter("@Pyjm", SqlDbType.VarChar,50) ,              
              new SqlParameter("@ddw", SqlDbType.VarChar,50) ,              
              new SqlParameter("@xdw", SqlDbType.VarChar,50) ,              
              new SqlParameter("@dwhsz", SqlDbType.Decimal,9) ,              
              new SqlParameter("@jj", SqlDbType.Money) ,              
              new SqlParameter("@Lsj_Jsz", SqlDbType.Decimal,9) ,              
              new SqlParameter("@Lsj_Csxs", SqlDbType.Decimal,9) ,              
              new SqlParameter("@pfj_Jsz", SqlDbType.Decimal,9) ,              
              new SqlParameter("@pfj_Csxs", SqlDbType.Decimal,9) ,              
              new SqlParameter("@pfj", SqlDbType.Money) ,              
              new SqlParameter("@Jmlsj", SqlDbType.Money) ,              
              new SqlParameter("@pfzk", SqlDbType.Decimal,9) ,              
              new SqlParameter("@Hyzz", SqlDbType.Decimal,9) ,              
              new SqlParameter("@Hyyh", SqlDbType.Decimal,9) ,              
              new SqlParameter("@tp", SqlDbType.Image) ,              
              new SqlParameter("@spzt", SqlDbType.VarChar,50) ,              
              new SqlParameter("@qdpl", SqlDbType.Int,4) ,              
              new SqlParameter("@Ccrq", SqlDbType.DateTime) ,              
              new SqlParameter("@bzq", SqlDbType.Int,4) ,              
              new SqlParameter("@tqyjts", SqlDbType.Int,4) ,              
              new SqlParameter("@zdkc", SqlDbType.Int,4) ,              
              new SqlParameter("@zxkc", SqlDbType.Int,4) ,              
              new SqlParameter("@zjhl", SqlDbType.Int,4) ,              
              new SqlParameter("@bz", SqlDbType.VarChar,50) ,              
              new SqlParameter("@zhjhsj", SqlDbType.DateTime) ,              
              new SqlParameter("@sccgybh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@djyh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@djsj", SqlDbType.DateTime) ,              
              new SqlParameter("@xgyh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@xgsj", SqlDbType.DateTime) ,              
              new SqlParameter("@cwm", SqlDbType.VarChar,50) ,              
              new SqlParameter("@fhljs", SqlDbType.Int,4) ,              
              new SqlParameter("@sfdz", SqlDbType.Bit) ,              
              new SqlParameter("@dysl", SqlDbType.Int,4) ,              
              new SqlParameter("@ydy", SqlDbType.Bit) ,              
              new SqlParameter("@drlsh", SqlDbType.Int,4)};             
                   if (model.DjLsh != null)  
              parameters[0].Value = model.DjLsh;  
           else  
              parameters[0].Value = DBNull.Value;  
              
           if (model.DjBtZdh != null)  
              parameters[1].Value = model.DjBtZdh;  
           else  
              parameters[1].Value = DBNull.Value;  
              
           if (model.DjFtZdh != null)  
              parameters[2].Value = model.DjFtZdh;  
           else  
              parameters[2].Value = DBNull.Value;  
              
           if (model.DjStZdh != null)  
              parameters[3].Value = model.DjStZdh;  
           else  
              parameters[3].Value = DBNull.Value;  
              
           if (model.DjState != null)  
              parameters[4].Value = model.DjState;  
           else  
              parameters[4].Value = DBNull.Value;  
              
           if (model.DjCount != null)  
              parameters[5].Value = model.DjCount;  
           else  
              parameters[5].Value = DBNull.Value;  
              
           if (model.bhfs != null)  
              parameters[6].Value = model.bhfs;  
           else  
              parameters[6].Value = DBNull.Value;  
              
           if (model.djcl != null)  
              parameters[7].Value = model.djcl;  
           else  
              parameters[7].Value = DBNull.Value;  
              
           if (model.lsh != null)  
              parameters[8].Value = model.lsh;  
           else  
              parameters[8].Value = DBNull.Value;  
              
           if (model.rq != null)  
              parameters[9].Value = model.rq;  
           else  
              parameters[9].Value = DBNull.Value;  
              
           if (model.dlbh != null)  
              parameters[10].Value = model.dlbh;  
           else  
              parameters[10].Value = DBNull.Value;  
              
           if (model.dlmc != null)  
              parameters[11].Value = model.dlmc;  
           else  
              parameters[11].Value = DBNull.Value;  
              
           if (model.xlbh != null)  
              parameters[12].Value = model.xlbh;  
           else  
              parameters[12].Value = DBNull.Value;  
              
           if (model.xlmc != null)  
              parameters[13].Value = model.xlmc;  
           else  
              parameters[13].Value = DBNull.Value;  
              
           if (model.gysbh != null)  
              parameters[14].Value = model.gysbh;  
           else  
              parameters[14].Value = DBNull.Value;  
              
           if (model.Gysmc != null)  
              parameters[15].Value = model.Gysmc;  
           else  
              parameters[15].Value = DBNull.Value;  
              
           if (model.cjhh != null)  
              parameters[16].Value = model.cjhh;  
           else  
              parameters[16].Value = DBNull.Value;  
              
           if (model.spbh != null)  
              parameters[17].Value = model.spbh;  
           else  
              parameters[17].Value = DBNull.Value;  
              
           if (model.tmh != null)  
              parameters[18].Value = model.tmh;  
           else  
              parameters[18].Value = DBNull.Value;  
              
           if (model.spmc != null)  
              parameters[19].Value = model.spmc;  
           else  
              parameters[19].Value = DBNull.Value;  
              
           if (model.gg != null)  
              parameters[20].Value = model.gg;  
           else  
              parameters[20].Value = DBNull.Value;  
              
           if (model.ysbh != null)  
              parameters[21].Value = model.ysbh;  
           else  
              parameters[21].Value = DBNull.Value;  
              
           if (model.ysmc != null)  
              parameters[22].Value = model.ysmc;  
           else  
              parameters[22].Value = DBNull.Value;  
              
           if (model.cm != null)  
              parameters[23].Value = model.cm;  
           else  
              parameters[23].Value = DBNull.Value;  
              
           if (model.Pyjm != null)  
              parameters[24].Value = model.Pyjm;  
           else  
              parameters[24].Value = DBNull.Value;  
              
           if (model.ddw != null)  
              parameters[25].Value = model.ddw;  
           else  
              parameters[25].Value = DBNull.Value;  
              
           if (model.xdw != null)  
              parameters[26].Value = model.xdw;  
           else  
              parameters[26].Value = DBNull.Value;  
              
           if (model.dwhsz != null)  
              parameters[27].Value = model.dwhsz;  
           else  
              parameters[27].Value = DBNull.Value;  
              
           if (model.jj != null)  
              parameters[28].Value = model.jj;  
           else  
              parameters[28].Value = DBNull.Value;  
              
           if (model.Lsj_Jsz != null)  
              parameters[29].Value = model.Lsj_Jsz;  
           else  
              parameters[29].Value = DBNull.Value;  
              
           if (model.Lsj_Csxs != null)  
              parameters[30].Value = model.Lsj_Csxs;  
           else  
              parameters[30].Value = DBNull.Value;  
              
           if (model.pfj_Jsz != null)  
              parameters[31].Value = model.pfj_Jsz;  
           else  
              parameters[31].Value = DBNull.Value;  
              
           if (model.pfj_Csxs != null)  
              parameters[32].Value = model.pfj_Csxs;  
           else  
              parameters[32].Value = DBNull.Value;  
              
           if (model.pfj != null)  
              parameters[33].Value = model.pfj;  
           else  
              parameters[33].Value = DBNull.Value;  
              
           if (model.Jmlsj != null)  
              parameters[34].Value = model.Jmlsj;  
           else  
              parameters[34].Value = DBNull.Value;  
              
           if (model.pfzk != null)  
              parameters[35].Value = model.pfzk;  
           else  
              parameters[35].Value = DBNull.Value;  
              
           if (model.Hyzz != null)  
              parameters[36].Value = model.Hyzz;  
           else  
              parameters[36].Value = DBNull.Value;  
              
           if (model.Hyyh != null)  
              parameters[37].Value = model.Hyyh;  
           else  
              parameters[37].Value = DBNull.Value;  
              
           if (model.tp != null)  
              parameters[38].Value = model.tp;  
           else  
              parameters[38].Value = DBNull.Value;  
              
           if (model.spzt != null)  
              parameters[39].Value = model.spzt;  
           else  
              parameters[39].Value = DBNull.Value;  
              
           if (model.qdpl != null)  
              parameters[40].Value = model.qdpl;  
           else  
              parameters[40].Value = DBNull.Value;  
              
           if (model.Ccrq != null)  
              parameters[41].Value = model.Ccrq;  
           else  
              parameters[41].Value = DBNull.Value;  
              
           if (model.bzq != null)  
              parameters[42].Value = model.bzq;  
           else  
              parameters[42].Value = DBNull.Value;  
              
           if (model.tqyjts != null)  
              parameters[43].Value = model.tqyjts;  
           else  
              parameters[43].Value = DBNull.Value;  
              
           if (model.zdkc != null)  
              parameters[44].Value = model.zdkc;  
           else  
              parameters[44].Value = DBNull.Value;  
              
           if (model.zxkc != null)  
              parameters[45].Value = model.zxkc;  
           else  
              parameters[45].Value = DBNull.Value;  
              
           if (model.zjhl != null)  
              parameters[46].Value = model.zjhl;  
           else  
              parameters[46].Value = DBNull.Value;  
              
           if (model.bz != null)  
              parameters[47].Value = model.bz;  
           else  
              parameters[47].Value = DBNull.Value;  
              
           if (model.zhjhsj != null)  
              parameters[48].Value = model.zhjhsj;  
           else  
              parameters[48].Value = DBNull.Value;  
              
           if (model.sccgybh != null)  
              parameters[49].Value = model.sccgybh;  
           else  
              parameters[49].Value = DBNull.Value;  
              
           if (model.djyh != null)  
              parameters[50].Value = model.djyh;  
           else  
              parameters[50].Value = DBNull.Value;  
              
           if (model.djsj != null)  
              parameters[51].Value = model.djsj;  
           else  
              parameters[51].Value = DBNull.Value;  
              
           if (model.xgyh != null)  
              parameters[52].Value = model.xgyh;  
           else  
              parameters[52].Value = DBNull.Value;  
              
           if (model.xgsj != null)  
              parameters[53].Value = model.xgsj;  
           else  
              parameters[53].Value = DBNull.Value;  
              
           if (model.cwm != null)  
              parameters[54].Value = model.cwm;  
           else  
              parameters[54].Value = DBNull.Value;  
              
           if (model.fhljs != null)  
              parameters[55].Value = model.fhljs;  
           else  
              parameters[55].Value = DBNull.Value;  
              
           if (model.sfdz != null)  
              parameters[56].Value = model.sfdz;  
           else  
              parameters[56].Value = DBNull.Value;  
              
           if (model.dysl != null)  
              parameters[57].Value = model.dysl;  
           else  
              parameters[57].Value = DBNull.Value;  
              
           if (model.ydy != null)  
              parameters[58].Value = model.ydy;  
           else  
              parameters[58].Value = DBNull.Value;  
              
           if (model.drlsh != null)  
              parameters[59].Value = model.drlsh;  
           else  
              parameters[59].Value = DBNull.Value;  
              
           int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); 
  			if (rows > 0) 
  			{ 
  				return true; 
  			} 
  			else 
  			{ 
  				return false; 
  			} 
  		} 
  		 
  		 
  		/// <summary> 
  		/// 更新一条数据(字符串) 2016-07-13更新 
  		///   2017-03-23更新 minjie 
  		/// </summary> 
  		public  string  UpdateStr(spdaH_Entity model) 
  		{ 
  				if(model.DjLsh==null) 
  				{ 
  					model.DjLsh=0; 
  				} 
  				if(model.DjBtZdh==null) 
  				{ 
  					model.DjBtZdh=0; 
  				} 
  				if(model.DjFtZdh==null) 
  				{ 
  					model.DjFtZdh=0; 
  				} 
  				if(model.DjStZdh==null) 
  				{ 
  					model.DjStZdh=0; 
  				} 
  				if(model.DjState==null) 
  				{ 
  					model.DjState="";  
  				} 
  				if(model.DjCount==null) 
  				{ 
  					model.DjCount=0; 
  				} 
  				if(model.bhfs==null) 
  				{ 
  					model.bhfs="";  
  				} 
  				if(model.djcl==null) 
  				{ 
  					model.djcl="";  
  				} 
  				if(model.lsh==null) 
  				{ 
  					model.lsh=0; 
  				} 
  				if(model.rq==null) 
  				{ 
  					model.rq="";  
  				} 
  				if(model.dlbh==null) 
  				{ 
  					model.dlbh="";  
  				} 
  				if(model.dlmc==null) 
  				{ 
  					model.dlmc="";  
  				} 
  				if(model.xlbh==null) 
  				{ 
  					model.xlbh="";  
  				} 
  				if(model.xlmc==null) 
  				{ 
  					model.xlmc="";  
  				} 
  				if(model.gysbh==null) 
  				{ 
  					model.gysbh="";  
  				} 
  				if(model.Gysmc==null) 
  				{ 
  					model.Gysmc="";  
  				} 
  				if(model.cjhh==null) 
  				{ 
  					model.cjhh="";  
  				} 
  				if(model.spbh==null) 
  				{ 
  					model.spbh="";  
  				} 
  				if(model.tmh==null) 
  				{ 
  					model.tmh="";  
  				} 
  				if(model.spmc==null) 
  				{ 
  					model.spmc="";  
  				} 
  				if(model.gg==null) 
  				{ 
  					model.gg="";  
  				} 
  				if(model.ysbh==null) 
  				{ 
  					model.ysbh="";  
  				} 
  				if(model.ysmc==null) 
  				{ 
  					model.ysmc="";  
  				} 
  				if(model.cm==null) 
  				{ 
  					model.cm="";  
  				} 
  				if(model.Pyjm==null) 
  				{ 
  					model.Pyjm="";  
  				} 
  				if(model.ddw==null) 
  				{ 
  					model.ddw="";  
  				} 
  				if(model.xdw==null) 
  				{ 
  					model.xdw="";  
  				} 
  				if(model.dwhsz==null) 
  				{ 
  					model.dwhsz=0; 
  				} 
  				if(model.jj==null) 
  				{ 
  					model.jj=0; 
  				} 
  				if(model.Lsj_Jsz==null) 
  				{ 
  					model.Lsj_Jsz=0; 
  				} 
  				if(model.Lsj_Csxs==null) 
  				{ 
  					model.Lsj_Csxs=0; 
  				} 
  				if(model.pfj_Jsz==null) 
  				{ 
  					model.pfj_Jsz=0; 
  				} 
  				if(model.pfj_Csxs==null) 
  				{ 
  					model.pfj_Csxs=0; 
  				} 
  				if(model.pfj==null) 
  				{ 
  					model.pfj=0; 
  				} 
  				if(model.Jmlsj==null) 
  				{ 
  					model.Jmlsj=0; 
  				} 
  				if(model.pfzk==null) 
  				{ 
  					model.pfzk=0; 
  				} 
  				if(model.Hyzz==null) 
  				{ 
  					model.Hyzz=0; 
  				} 
  				if(model.Hyyh==null) 
  				{ 
  					model.Hyyh=0; 
  				} 
  			 
  				if(model.spzt==null) 
  				{ 
  					model.spzt="";  
  				} 
  				if(model.qdpl==null) 
  				{ 
  					model.qdpl=0; 
  				} 
  				if(model.bzq==null) 
  				{ 
  					model.bzq=0; 
  				} 
  				if(model.tqyjts==null) 
  				{ 
  					model.tqyjts=0; 
  				} 
  				if(model.zdkc==null) 
  				{ 
  					model.zdkc=0; 
  				} 
  				if(model.zxkc==null) 
  				{ 
  					model.zxkc=0; 
  				} 
  				if(model.zjhl==null) 
  				{ 
  					model.zjhl=0; 
  				} 
  				if(model.bz==null) 
  				{ 
  					model.bz="";  
  				} 
  				if(model.sccgybh==null) 
  				{ 
  					model.sccgybh="";  
  				} 
  				if(model.djyh==null) 
  				{ 
  					model.djyh="";  
  				} 
  				if(model.xgyh==null) 
  				{ 
  					model.xgyh="";  
  				} 
  				if(model.cwm==null) 
  				{ 
  					model.cwm="";  
  				} 
  				if(model.fhljs==null) 
  				{ 
  					model.fhljs=0; 
  				} 
  				if(model.sfdz==null) 
  				{ 
  					model.sfdz=false;  
  				} 
  				if(model.dysl==null) 
  				{ 
  					model.dysl=0; 
  				} 
  				if(model.ydy==null) 
  				{ 
  					model.ydy=false;  
  				} 
  				if(model.drlsh==null) 
  				{ 
  					model.drlsh=0; 
  				} 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("update spdaH set "); 
              strSql.Append(" DjLsh = "+model.DjLsh+","); 
              strSql.Append(" DjBtZdh = "+model.DjBtZdh+","); 
              strSql.Append(" DjFtZdh = "+model.DjFtZdh+","); 
              strSql.Append(" DjStZdh = "+model.DjStZdh+","); 
              strSql.Append(" DjState ='"+ model.DjState+"',"); 
              strSql.Append(" DjCount = "+model.DjCount+","); 
              strSql.Append(" bhfs ='"+ model.bhfs+"',"); 
              strSql.Append(" djcl ='"+ model.djcl+"',"); 
              strSql.Append(" lsh = "+model.lsh+","); 
              strSql.Append(" rq ='"+ model.rq+"',"); 
              strSql.Append(" dlbh ='"+ model.dlbh+"',"); 
              strSql.Append(" dlmc ='"+ model.dlmc+"',"); 
              strSql.Append(" xlbh ='"+ model.xlbh+"',"); 
              strSql.Append(" xlmc ='"+ model.xlmc+"',"); 
              strSql.Append(" gysbh ='"+ model.gysbh+"',"); 
              strSql.Append(" Gysmc ='"+ model.Gysmc+"',"); 
              strSql.Append(" cjhh ='"+ model.cjhh+"',"); 
              strSql.Append(" spbh ='"+ model.spbh+"',"); 
              strSql.Append(" tmh ='"+ model.tmh+"',"); 
              strSql.Append(" spmc ='"+ model.spmc+"',"); 
              strSql.Append(" gg ='"+ model.gg+"',"); 
              strSql.Append(" ysbh ='"+ model.ysbh+"',"); 
              strSql.Append(" ysmc ='"+ model.ysmc+"',"); 
              strSql.Append(" cm ='"+ model.cm+"',"); 
              strSql.Append(" Pyjm ='"+ model.Pyjm+"',"); 
              strSql.Append(" ddw ='"+ model.ddw+"',"); 
              strSql.Append(" xdw ='"+ model.xdw+"',"); 
              strSql.Append(" dwhsz = "+model.dwhsz+","); 
              strSql.Append(" jj = "+model.jj+","); 
              strSql.Append(" Lsj_Jsz = "+model.Lsj_Jsz+","); 
              strSql.Append(" Lsj_Csxs = "+model.Lsj_Csxs+","); 
              strSql.Append(" pfj_Jsz = "+model.pfj_Jsz+","); 
              strSql.Append(" pfj_Csxs = "+model.pfj_Csxs+","); 
              strSql.Append(" pfj = "+model.pfj+","); 
              strSql.Append(" Jmlsj = "+model.Jmlsj+","); 
              strSql.Append(" pfzk = "+model.pfzk+","); 
              strSql.Append(" Hyzz = "+model.Hyzz+","); 
              strSql.Append(" Hyyh = "+model.Hyyh+","); 
              strSql.Append(" tp ='"+ model.tp+"',"); 
              strSql.Append(" spzt ='"+ model.spzt+"',"); 
              strSql.Append(" qdpl = "+model.qdpl+","); 
              strSql.Append(" Ccrq ='"+ model.Ccrq+"',"); 
              strSql.Append(" bzq = "+model.bzq+","); 
              strSql.Append(" tqyjts = "+model.tqyjts+","); 
              strSql.Append(" zdkc = "+model.zdkc+","); 
              strSql.Append(" zxkc = "+model.zxkc+","); 
              strSql.Append(" zjhl = "+model.zjhl+","); 
              strSql.Append(" bz ='"+ model.bz+"',"); 
              strSql.Append(" zhjhsj ='"+ model.zhjhsj+"',"); 
              strSql.Append(" sccgybh ='"+ model.sccgybh+"',"); 
              strSql.Append(" djyh ='"+ model.djyh+"',"); 
              strSql.Append(" djsj ='"+ model.djsj+"',"); 
              strSql.Append(" xgyh ='"+ model.xgyh+"',"); 
              strSql.Append(" xgsj ='"+ model.xgsj+"',"); 
              strSql.Append(" cwm ='"+ model.cwm+"',"); 
              strSql.Append(" fhljs = "+model.fhljs+","); 
              strSql.Append(" sfdz = '"+model.sfdz+"'"); 
              strSql.Append(" dysl = "+model.dysl+","); 
              strSql.Append(" ydy = '"+model.ydy+"'"); 
              strSql.Append(" drlsh ="+ model.drlsh+""); 
  			strSql.Append(" where   "); 
  						 
           return strSql.ToString(); 
  		} 
  		 
  		 
  		/// <summary> 
  		/// 删除一条数据 
  		/// </summary> 
  		public bool Delete() 
  		{ 
  			 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("delete from spdaH "); 
  			strSql.Append(" where  "); 
           SqlParameter[] parameters = { };  
  			 
   
  			int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); 
  			if (rows > 0) 
  			{ 
  				return true; 
  			} 
  			else 
  			{ 
  				return false; 
  			} 
  		} 
  		 
  		/// <summary> 
  		/// 批量删除一批数据 
  		/// </summary> 
  		public bool DeleteList(string lists ) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("delete from spdaH "); 
  			strSql.Append(" where ID in ("+ lists + ")  "); 
  			int rows=DbHelperSQL.ExecuteSql(strSql.ToString()); 
  			if (rows > 0) 
  			{ 
  				return true; 
  			} 
  			else 
  			{ 
  				return false; 
  			} 
  		} 
  		 
  		 
  		/// <summary> 
  		/// 得到一个对象实体 
  		/// </summary> 
  		public spdaH_Entity GetModel() 
  		{ 
  			 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("select  DjLsh,DjBtZdh,DjFtZdh,DjStZdh,DjState,DjCount,bhfs,djcl,lsh,rq,dlbh,dlmc,xlbh,xlmc,gysbh,Gysmc,cjhh,spbh,tmh,spmc,gg,ysbh,ysmc,cm,Pyjm,ddw,xdw,dwhsz,jj,Lsj_Jsz,Lsj_Csxs,pfj_Jsz,pfj_Csxs,pfj,Jmlsj,pfzk,Hyzz,Hyyh,tp,spzt,qdpl,Ccrq,bzq,tqyjts,zdkc,zxkc,zjhl,bz,zhjhsj,sccgybh,djyh,djsj,xgyh,xgsj,cwm,fhljs,sfdz,dysl,ydy,drlsh");			 
  	        strSql.Append("  from spdaH"); 
  			strSql.Append(" where   "); 
           SqlParameter[] parameters = { };  
  			 
  			 
  			spdaH_Entity model=new spdaH_Entity(); 
  			DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters); 
  		        DataTable dt=ds.Tables[0];	  
  				return DataTableToEntity(dt); 
  		} 
  		 
  		 
  		 
  		 
  		/// <summary> 
  		/// 将数据集(DataTable)转换 对象 spdaH_Entity
  		/// 创建人：minjie 
  		/// 创建时间:2019-01-17 01:36:37 
  		/// </summary> 
  		public spdaH_Entity DataTableToEntity(DataTable dt) 
  		{ 
  			spdaH_Entity model=new spdaH_Entity(); 
  			 
  			if(dt!=null&&dt.Rows.Count>0) 
  			{ 
  				if(dt.Rows[0]["DjLsh"]!=null&&dt.Rows[0]["DjLsh"].ToString()!="") 
  				{ 
  					model.DjLsh=int.Parse(dt.Rows[0]["DjLsh"].ToString()); 
  				} 
  				if(dt.Rows[0]["DjBtZdh"]!=null&&dt.Rows[0]["DjBtZdh"].ToString()!="") 
  				{ 
  					model.DjBtZdh=int.Parse(dt.Rows[0]["DjBtZdh"].ToString()); 
  				} 
  				if(dt.Rows[0]["DjFtZdh"]!=null&&dt.Rows[0]["DjFtZdh"].ToString()!="") 
  				{ 
  					model.DjFtZdh=int.Parse(dt.Rows[0]["DjFtZdh"].ToString()); 
  				} 
  				if(dt.Rows[0]["DjStZdh"]!=null&&dt.Rows[0]["DjStZdh"].ToString()!="") 
  				{ 
  					model.DjStZdh=int.Parse(dt.Rows[0]["DjStZdh"].ToString()); 
  				} 
  				model.DjState= dt.Rows[0]["DjState"].ToString(); 
  				if(dt.Rows[0]["DjCount"]!=null&&dt.Rows[0]["DjCount"].ToString()!="") 
  				{ 
  					model.DjCount=int.Parse(dt.Rows[0]["DjCount"].ToString()); 
  				} 
  				model.bhfs= dt.Rows[0]["bhfs"].ToString(); 
  				model.djcl= dt.Rows[0]["djcl"].ToString(); 
  				if(dt.Rows[0]["lsh"]!=null&&dt.Rows[0]["lsh"].ToString()!="") 
  				{ 
  					model.lsh=int.Parse(dt.Rows[0]["lsh"].ToString()); 
  				} 
  				model.rq= dt.Rows[0]["rq"].ToString(); 
  				model.dlbh= dt.Rows[0]["dlbh"].ToString(); 
  				model.dlmc= dt.Rows[0]["dlmc"].ToString(); 
  				model.xlbh= dt.Rows[0]["xlbh"].ToString(); 
  				model.xlmc= dt.Rows[0]["xlmc"].ToString(); 
  				model.gysbh= dt.Rows[0]["gysbh"].ToString(); 
  				model.Gysmc= dt.Rows[0]["Gysmc"].ToString(); 
  				model.cjhh= dt.Rows[0]["cjhh"].ToString(); 
  				model.spbh= dt.Rows[0]["spbh"].ToString(); 
  				model.tmh= dt.Rows[0]["tmh"].ToString(); 
  				model.spmc= dt.Rows[0]["spmc"].ToString(); 
  				model.gg= dt.Rows[0]["gg"].ToString(); 
  				model.ysbh= dt.Rows[0]["ysbh"].ToString(); 
  				model.ysmc= dt.Rows[0]["ysmc"].ToString(); 
  				model.cm= dt.Rows[0]["cm"].ToString(); 
  				model.Pyjm= dt.Rows[0]["Pyjm"].ToString(); 
  				model.ddw= dt.Rows[0]["ddw"].ToString(); 
  				model.xdw= dt.Rows[0]["xdw"].ToString(); 
  				if(dt.Rows[0]["dwhsz"]!=null&&dt.Rows[0]["dwhsz"].ToString()!="") 
  				{ 
  					model.dwhsz=decimal.Parse(dt.Rows[0]["dwhsz"].ToString()); 
  				} 
  				if(dt.Rows[0]["jj"]!=null&&dt.Rows[0]["jj"].ToString()!="") 
  				{ 
  					model.jj=decimal.Parse(dt.Rows[0]["jj"].ToString()); 
  				} 
  				if(dt.Rows[0]["Lsj_Jsz"]!=null&&dt.Rows[0]["Lsj_Jsz"].ToString()!="") 
  				{ 
  					model.Lsj_Jsz=decimal.Parse(dt.Rows[0]["Lsj_Jsz"].ToString()); 
  				} 
  				if(dt.Rows[0]["Lsj_Csxs"]!=null&&dt.Rows[0]["Lsj_Csxs"].ToString()!="") 
  				{ 
  					model.Lsj_Csxs=decimal.Parse(dt.Rows[0]["Lsj_Csxs"].ToString()); 
  				} 
  				if(dt.Rows[0]["pfj_Jsz"]!=null&&dt.Rows[0]["pfj_Jsz"].ToString()!="") 
  				{ 
  					model.pfj_Jsz=decimal.Parse(dt.Rows[0]["pfj_Jsz"].ToString()); 
  				} 
  				if(dt.Rows[0]["pfj_Csxs"]!=null&&dt.Rows[0]["pfj_Csxs"].ToString()!="") 
  				{ 
  					model.pfj_Csxs=decimal.Parse(dt.Rows[0]["pfj_Csxs"].ToString()); 
  				} 
  				if(dt.Rows[0]["pfj"]!=null&&dt.Rows[0]["pfj"].ToString()!="") 
  				{ 
  					model.pfj=decimal.Parse(dt.Rows[0]["pfj"].ToString()); 
  				} 
  				if(dt.Rows[0]["Jmlsj"]!=null&&dt.Rows[0]["Jmlsj"].ToString()!="") 
  				{ 
  					model.Jmlsj=decimal.Parse(dt.Rows[0]["Jmlsj"].ToString()); 
  				} 
  				if(dt.Rows[0]["pfzk"]!=null&&dt.Rows[0]["pfzk"].ToString()!="") 
  				{ 
  					model.pfzk=decimal.Parse(dt.Rows[0]["pfzk"].ToString()); 
  				} 
  				if(dt.Rows[0]["Hyzz"]!=null&&dt.Rows[0]["Hyzz"].ToString()!="") 
  				{ 
  					model.Hyzz=decimal.Parse(dt.Rows[0]["Hyzz"].ToString()); 
  				} 
  				if(dt.Rows[0]["Hyyh"]!=null&&dt.Rows[0]["Hyyh"].ToString()!="") 
  				{ 
  					model.Hyyh=decimal.Parse(dt.Rows[0]["Hyyh"].ToString()); 
  				} 
  				if(dt.Rows[0]["tp"]!=null&&dt.Rows[0]["tp"].ToString()!="") 
  				{ 
  					model.tp=  (byte[])(dt.Rows[0]["tp"]); 
  				} 
  				model.spzt= dt.Rows[0]["spzt"].ToString(); 
  				if(dt.Rows[0]["qdpl"]!=null&&dt.Rows[0]["qdpl"].ToString()!="") 
  				{ 
  					model.qdpl=int.Parse(dt.Rows[0]["qdpl"].ToString()); 
  				} 
  				if(dt.Rows[0]["Ccrq"]!=null&&dt.Rows[0]["Ccrq"].ToString()!="") 
  				{ 
  					model.Ccrq=DateTime.Parse(dt.Rows[0]["Ccrq"].ToString()); 
  				} 
  				if(dt.Rows[0]["bzq"]!=null&&dt.Rows[0]["bzq"].ToString()!="") 
  				{ 
  					model.bzq=int.Parse(dt.Rows[0]["bzq"].ToString()); 
  				} 
  				if(dt.Rows[0]["tqyjts"]!=null&&dt.Rows[0]["tqyjts"].ToString()!="") 
  				{ 
  					model.tqyjts=int.Parse(dt.Rows[0]["tqyjts"].ToString()); 
  				} 
  				if(dt.Rows[0]["zdkc"]!=null&&dt.Rows[0]["zdkc"].ToString()!="") 
  				{ 
  					model.zdkc=int.Parse(dt.Rows[0]["zdkc"].ToString()); 
  				} 
  				if(dt.Rows[0]["zxkc"]!=null&&dt.Rows[0]["zxkc"].ToString()!="") 
  				{ 
  					model.zxkc=int.Parse(dt.Rows[0]["zxkc"].ToString()); 
  				} 
  				if(dt.Rows[0]["zjhl"]!=null&&dt.Rows[0]["zjhl"].ToString()!="") 
  				{ 
  					model.zjhl=int.Parse(dt.Rows[0]["zjhl"].ToString()); 
  				} 
  				model.bz= dt.Rows[0]["bz"].ToString(); 
  				if(dt.Rows[0]["zhjhsj"]!=null&&dt.Rows[0]["zhjhsj"].ToString()!="") 
  				{ 
  					model.zhjhsj=DateTime.Parse(dt.Rows[0]["zhjhsj"].ToString()); 
  				} 
  				model.sccgybh= dt.Rows[0]["sccgybh"].ToString(); 
  				model.djyh= dt.Rows[0]["djyh"].ToString(); 
  				if(dt.Rows[0]["djsj"]!=null&&dt.Rows[0]["djsj"].ToString()!="") 
  				{ 
  					model.djsj=DateTime.Parse(dt.Rows[0]["djsj"].ToString()); 
  				} 
  				model.xgyh= dt.Rows[0]["xgyh"].ToString(); 
  				if(dt.Rows[0]["xgsj"]!=null&&dt.Rows[0]["xgsj"].ToString()!="") 
  				{ 
  					model.xgsj=DateTime.Parse(dt.Rows[0]["xgsj"].ToString()); 
  				} 
  				model.cwm= dt.Rows[0]["cwm"].ToString(); 
  				if(dt.Rows[0]["fhljs"]!=null&&dt.Rows[0]["fhljs"].ToString()!="") 
  				{ 
  					model.fhljs=int.Parse(dt.Rows[0]["fhljs"].ToString()); 
  				} 
  				if(dt.Rows[0]["sfdz"]!=null&&dt.Rows[0]["sfdz"].ToString()!="") 
  				{ 
  					if((dt.Rows[0]["sfdz"].ToString()=="1")||(dt.Rows[0]["sfdz"].ToString().ToLower()=="true")) 
  					{ 
  					model.sfdz= true; 
  					} 
  					else 
  					{ 
  					model.sfdz= false; 
  					} 
  				} 
  				if(dt.Rows[0]["dysl"]!=null&&dt.Rows[0]["dysl"].ToString()!="") 
  				{ 
  					model.dysl=int.Parse(dt.Rows[0]["dysl"].ToString()); 
  				} 
  				if(dt.Rows[0]["ydy"]!=null&&dt.Rows[0]["ydy"].ToString()!="") 
  				{ 
  					if((dt.Rows[0]["ydy"].ToString()=="1")||(dt.Rows[0]["ydy"].ToString().ToLower()=="true")) 
  					{ 
  					model.ydy= true; 
  					} 
  					else 
  					{ 
  					model.ydy= false; 
  					} 
  				} 
  				if(dt.Rows[0]["drlsh"]!=null&&dt.Rows[0]["drlsh"].ToString()!="") 
  				{ 
  					model.drlsh=int.Parse(dt.Rows[0]["drlsh"].ToString()); 
  				} 
  				return model; 
  			} 
  			else 
  			{ 
  				return null; 
  			} 
  		} 
  		 
  		/// <summary> 
  		/// 分页获取数据列表 
  		/// </summary> 
  		public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  		 strSql.Append("SELECT * FROM ( "); 
  		 strSql.Append(" SELECT ROW_NUMBER() OVER ("); 
  if (!string.IsNullOrEmpty(orderby.Trim())) 
 { 
    strSql.Append("order by " ); 
 } 
else  
 { 
     strSql.Append("order by  desc"); 
 } 
		 strSql.Append(")AS Row, T.*  from spdaH T "); 
  		 if (!string.IsNullOrEmpty(strWhere.Trim()))  
  			{ 
  			 strSql.Append(" WHERE " + strWhere); 
  			} 
  		    strSql.Append(" ) TT"); 
  	        strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);			return DbHelperSQL.Query(strSql.ToString()); 
  		} 
  		 
  		 
  		/// <summary> 
  		/// 获得数据列表 
  		/// </summary> 
  		public DataSet GetList(string strWhere) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("select * "); 
  			strSql.Append(" FROM spdaH "); 
  			if(strWhere.Trim()!="") 
  			{ 
  				strSql.Append(" where "+strWhere); 
  			} 
  			return DbHelperSQL.Query(strSql.ToString()); 
  		} 
  		 
  		/// <summary> 
  		/// 获得前几行数据 
  		/// </summary> 
  		public DataSet GetList(int Top,string strWhere,string filedOrder) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("select "); 
  			if(Top>0) 
  			{ 
  				strSql.Append(" top "+Top.ToString()); 
  			} 
  			strSql.Append(" * "); 
  			strSql.Append(" FROM spdaH "); 
  			if(strWhere.Trim()!="") 
  			{ 
  				strSql.Append(" where "+strWhere); 
  			} 
  			strSql.Append(" order by " + filedOrder); 
  			return DbHelperSQL.Query(strSql.ToString()); 
  		} 
  		/// <summary> 
  		/// 批量处理  
  		/// </summary> 
  		public int ExecuteSqlTran(List<string> ls,ref string error) 
  		{ 
  			return DbHelperSQL.ExecuteSqlTran(ls,ref   error); 
  		} 
  		 
  		/// <summary> 
  		/// 执行sql语句  
  		/// </summary> 
  		public int ExecuteSql(string sql) 
  		{ 
  			return DbHelperSQL.ExecuteSql(sql); 
  		} 
  		 
  		/// <summary> 
  		/// 执行sql语句  
  		/// </summary> 
  		public string GetSingle(string sql) 
  		{ 
  			object obj= DbHelperSQL.GetSingle(sql); 
  			 if (obj != null) 
  			 { 
  			    return obj.ToString(); 
  		     } 
  		     else 
  		        return ""; 
  		} 
  		 
  		/// <summary> 
  		/// 执行sql语句  
  		/// </summary> 
  		public DataTable  ExecuteDt(string sql) 
  		{ 
  			return DbHelperSQL.ExecuteDt(sql); 
  		} 
  		 
  		 
  		/// <summary> 
  		/// 获得记录条数 
  		/// </summary> 
  		public int GetRecordCount(string strWhere) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("select count(1) "); 
  			strSql.Append(" FROM spdaH "); 
  			if(strWhere.Trim()!="") 
  			{ 
  				strSql.Append(" where "+strWhere); 
  			} 
  		   object obj=	DbHelperSQL.GetSingle(strSql.ToString()); 
  			if(obj!=null && obj.ToString()!="") 
  			{ 
              	return Convert.ToInt32(obj); 
  			} 
  			else 
  			return 0; 
  		} 
   
      
  	} 
  
}
